/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.cooperativa.entities;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author giovanny
 */
@Entity
@Table(name = "correlativos")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Correlativos.findAll", query = "SELECT c FROM Correlativos c"),
    @NamedQuery(name = "Correlativos.findByGenName", query = "SELECT c FROM Correlativos c WHERE c.genName = :genName"),
    @NamedQuery(name = "Correlativos.findByGenVal", query = "SELECT c FROM Correlativos c WHERE c.genVal = :genVal")})
public class Correlativos implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @NotNull
    @Size(min = 1, max = 100)
    @Column(name = "gen_name")
    private String genName;
    @Column(name = "gen_val")
    private Integer genVal;

    public Correlativos() {
    }

    public Correlativos(String genName) {
        this.genName = genName;
    }

    public String getGenName() {
        return genName;
    }

    public void setGenName(String genName) {
        this.genName = genName;
    }

    public Integer getGenVal() {
        return genVal;
    }

    public void setGenVal(Integer genVal) {
        this.genVal = genVal;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (genName != null ? genName.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Correlativos)) {
            return false;
        }
        Correlativos other = (Correlativos) object;
        if ((this.genName == null && other.genName != null) || (this.genName != null && !this.genName.equals(other.genName))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "org.cooperativa.entities.Correlativos[ genName=" + genName + " ]";
    }
    
}
